import request from "@/utils/request";
import https from "@/utils/https.js";
import host from "@/utils/host.js";

export default {
  //登录
  login(data) {
    return https.request({
      url: "/login/pwd",
      method: "post",
      data
    });
  },

  //用户列表
  users(data) {
    return https.request({
      url: "/user/page",
      method: "get",
      data
    });
  },

  //删除用户
  userDel(data) {
    return https.request({
      url: "/user/delete",
      method: "post",
      data
    });
  },

  //新增用户
  userAdd(data) {
    return https.request({
      url: "/user/add",
      method: "post",
      data
    });
  },

  //编辑用户
  userUpdate(data) {
    return https.request({
      url: "/user/update",
      method: "post",
      data
    });
  },

  //用户详情
  userDetails(data) {
    return https.request({
      url: "/user/detail",
      method: "get",
      data
    });
  },

  //角色列表 - 分页
  roleList(data) {
    return https.request({
      url: "/login/role/page",
      method: "get",
      data
    });
  },

  //角色删除
  roleDel(data) {
    return https.request({
      url: "/login/role/delete",
      method: "get",
      data
    });
  },

  //角色新增
  roleAdd(data) {
    return https.request({
      url: "/login/role/add",
      method: "post",
      data
    });
  },

  //角色编辑
  roleUpdate(data) {
    return https.request({
      url: "/login/role/update",
      method: "post",
      data
    });
  },

  //角色-不分页
  roleQuery(data) {
    return https.request({
      url: "/login/role/list",
      method: "get",
      data
    });
  },

  //角色详情 
  roleDetail(data) {
    return https.request({
      url: "/login/role/detail",
      method: "get",
      data
    });
  },

  //菜单列表
  menuList(data) {
    return https.request({
      url: "/menu/list",
      method: "get",
      data
    });
  },

  //菜单删除
  menuDel(data) {
    return https.request({
      url: `/menu/delete?id=${data}`,
      method: "post",
    });
  },

  //菜单新增
  menuAdd(data) {
    return https.request({
      url: `/menu/add`,
      method: "post",
      data
    });
  },

  //菜单编辑
  menuUpdate(data) {
    return https.request({
      url: `/menu/update`,
      method: "post",
      data
    });
  },

  //工种类别列表
  workTypeList(data) {
    return https.request({
      url: `/workType/all`,
      method: "get",
      data
    });
  },

  //工种类别新增
  workTypeAdd(data) {
    return https.request({
      url: `/workType/add`,
      method: "post",
      data
    });
  },

  //工种类别编辑
  workTypeUpdate(data) {
    return https.request({
      url: `/workType/update`,
      method: "post",
      data
    });
  },

  //工种类别删除
  workTypeDel(data) {
    return https.request({
      url: `/workType/delete`,
      method: "post",
      data
    });
  },

  //字典列表
  dictionaryList(data) {
    return https.request({
      url: `/dictionary/getAll`,
      method: "post",
      data
    });
  },

  //字典编辑 
  dictionaryUpdate(data) {
    return https.request({
      url: `/dictionary/update`,
      method: "post",
      data
    });
  },

  //字典新增
  dictionaryAdd(data) {
    return https.request({
      url: `/dictionary/add`,
      method: "post",
      data
    });
  },

  //字典详情
  dictionaryDetail(data) {
    return https.request({
      url: `/dictionary/detail`,
      method: "get",
      data
    });
  },

  //字典删除
  dictionaryDel(id) {
    return https.request({
      url: `/dictionary/delete?id=${id}`,
      method: "post",
    });
  },

  //字典根据父类id查询子类
  getSonByPid(data) {
    return https.request({
      url: `/dictionary/getSonByPid`,
      method: "get",
      data
    });
  },

  //字典根据父类code查询子类
  getSonByPidOrCode(data) {
    return https.request({
      url: `/dictionary/getSonByPidOrCode`,
      method: "get",
      data
    });
  },

  //banner-列表
  bannerList(data) {
    return https.request({
      url: `/banner/page`,
      method: "get",
      data
    });
  },

  //banner-新增
  bannerAdd(data) {
    return https.request({
      url: `/banner/add`,
      method: "post",
      data
    });
  },

  //banner-编辑
  bannerUpdate(data) {
    return https.request({
      url: `/banner/update`,
      method: "post",
      data
    });
  },

  //banner-详情
  bannerDetail(data) {
    return https.request({
      url: `/banner/detail`,
      method: "get",
      data
    });
  },

  //banner-删除
  bannerDel(data) {
    return https.request({
      url: `/banner/delete`,
      method: "post",
      data
    });
  },

  //获取七牛云token
  qiniuToken(data) {
    return https.request({
      url: `/config/common/qiniu/token`,
      method: "get",
      data
    });
  },

  //招工管理-列表
  pcPostingPage(data) {
    return https.request({
      url: `/jobPost/pcPostingPage`,
      method: "get",
      data
    });
  },

  //招工管理-审批
  jobPostAudit(data) {
    return https.request({
      url: `/jobPost/audit`,
      method: "post",
      data
    });
  },

  //招工管理-详情
  pcPostingDetail(data) {
    return https.request({
      url: `/jobPost/pcPostingDetail?id=${data}`,
      method: "get",
    });
  },

  //招工记录-拨打电话
  pcCallHistory(data) {
    return https.request({
      url: `/jobPost/pcCallHistory`,
      method: "get",
      data
    });
  },

  //会员列表
  appUser(data) {
    return https.request({
      url: `/appUser/page`,
      method: "get",
      data
    });
  },

  //会员列表-不分页
  appUserAll(data) {
    return https.request({
      url: `/appUser/all`,
      method: "get",
      data
    });
  },

  //会员详情
  appDetail(data) {
    return https.request({
      url: `/appUser/detail`,
      method: "get",
      data
    });
  },

  //工人案例列表
  workCaseList(data) {
    return https.request({
      url: `/workCase/page`,
      method: "post",
      data
    });
  },

  //工人案例-删除
  workCaseDel(data) {
    return https.request({
      url: `/workCase/delete?workId=${data}`,
      method: "post",
      data
    });
  },

  //工人案例-审批
  workCaseAudit(data) {
    return https.request({
      url: `/workCase/auditWork`,
      method: "post",
      data
    });
  },

  //工人案例-详情
  workCaseDetail(data) {
    return https.request({
      url: `/workCase/getDetail`,
      method: "get",
      data
    });
  },

  //工人案例-个人详情
  workCaseSelfDetail(data) {
    return https.request({
      url: `/workCase/getSelfDetail`,
      method: "get",
      data
    });
  },

  //会员平台币-列表
  userCoinRecharge(data) {
    return https.request({
      url: `/wallet/userCoinRecharge`,
      method: "post",
      data
    });
  },

  //装修公司-列表
  finishCompanyControllerPage(data) {
    return https.request({
      url: `/finishCompanyController/page`,
      method: "post",
      data
    });
  },

  //装修公司-审核
  finishCompanyControllerAudit(data) {
    return https.request({
      url: `/finishCompanyController/auditCompany`,
      method: "post",
      data
    });
  },

  //装修公司-详情
  finishCompanyControllerDetail(data) {
    return https.request({
      url: `/finishCompanyController/getDetail`,
      method: "get",
      data
    });
  },

  //装修公司-删除
  finishCompanyControllerDel(data) {
    return https.request({
      url: `/finishCompanyController/delete?workId=${data}`,
      method: "post",
      data
    });
  },

  //装修公司日记-列表
  companyDiaryControllerPage(data) {
    return https.request({
      url: `/companyDiaryController/page`,
      method: "post",
      data
    });
  },

  //装修公司日记-审核
  companyDiaryControllerAudit(data) {
    return https.request({
      url: `/companyDiaryController/audit`,
      method: "post",
      data
    });
  },

  //装修公司日记-删除
  companyDiaryControllerDel(data) {
    return https.request({
      url: `/companyDiaryController/delete?id=${data}`,
      method: "post",

    });
  },

  //蜂鸟订单-分页
  platformOrderPage(data) {
    return https.request({
      url: `/platformOrder/pcOrderPage`,
      method: "post",
      data
    });
  },

  //蜂鸟订单-新增
  platformOrderAdd(data) {
    return https.request({
      url: `/platformOrder/addOrder`,
      method: "post",
      data
    });
  },

  //蜂鸟订单-删除
  platformOrderDel(data) {
    return https.request({
      url: `/platformOrder/delete`,
      method: "post",
      data
    });
  },

  //省市区
  areaDist(data) {
    return https.request({
      url: `/dictionary/areaDist`,
      method: "get",
      data
    });
  },

  //指派订单
  assignOrder(data) {
    return https.request({
      url: `/platformOrder/assignOrder`,
      method: "post",
      data
    });
  },

  //版本信息
  versionPage(data) {
    return https.request({
      url: `/version/page`,
      method: "post",
      data
    });
  },

  //版本信息-删除
  versionDel(data) {
    return https.request({
      url: `/version/delete`,
      method: "post",
      data
    });
  },

  //版本信息-发布
  versionInsert(data) {
    return https.request({
      url: `/version/insert`,
      method: "post",
      data
    });
  },

  //版本信息-更新
  versionUpdate(data) {
    return https.request({
      url: `/version/update`,
      method: "post",
      data
    });
  },

  //版本信息-详情
  versionDetail(data) {
    return https.request({
      url: `/version/getDetailById`,
      method: "get",
      data
    });
  },

  //订单小记-分页
  platformOrderNoteList(data) {
    return https.request({
      url: `/platformOrderNote/notePage`,
      method: "post",
      data
    });
  },

  //订单小记-详情
  platformOrderNoteDetail(data) {
    return https.request({
      url: `/platformOrderNote/detail`,
      method: "get",
      data
    });
  },

  //工人案例日志
  workDiaryPage(data) {
    return https.request({
      url: `/workDiary/page`,
      method: "post",
      data
    });
  },

  //工人案例日志-删除
  workDiaryDel(data) {
    return https.request({
      url: `/workDiary/delete?id=${data}`,
      method: "post",
    });
  },

  //工人案例日志-审核
  workDiaryAudit(data) {
    return https.request({
      url: `/workDiary/audit`,
      method: "post",
      data
    });
  },

  //工人案例评论
  workCaseEvaluatePage(data) {
    return https.request({
      url: `/WorkCaseEvaluate/page`,
      method: "post",
      data
    });
  },

  //工人案例评论-删除
  workCaseEvaluateDel(data) {
    return https.request({
      url: `/WorkCaseEvaluate/delete?id=${data}`,
      method: "post",
    });
  },

  //工人案例评论-审核
  workCaseEvaluateAudit(data) {
    return https.request({
      url: `/WorkCaseEvaluate/audit`,
      method: "post",
      data
    });
  },
}